#{extends 'main.html' /}
#{set 'moreScripts'}



<link rel="stylesheet" href="@{'/public/stylesheets/forms.css'}">

<link rel="stylesheet" href="@{'/public/stylesheets/css3buttons.css'}">


<script type="text/javascript"
	src="@{'/public/javascripts/FancyBox/jquery.fancybox-1.3.4.pack.js'}"></script>

<link rel="stylesheet" type="text/css"
	href="@{'/public/stylesheets/jquery.fancybox-1.3.4.css'}"
	media="screen">

<script type="text/javascript"
	src="@{'/public/javascripts/FancyBox/jquery.easing-1.3.pack.js'}"></script>

<script type="text/javascript"
	src="@{'/public/javascripts/FancyBox/jquery.mousewheel-3.0.4.pack.js'}"></script>

<script type="text/javascript">
jQuery(document).ready(function() {

	jQuery("#link").fancybox({
			'width' : '80%',
			'height' : '100%',
			'autoScale' : true,
			'transitionIn' : 'none',
			'transitionOut' : 'none',
			'type' : 'iframe',
			'onClosed': function() {
				    parent.location.reload(true); ;
				  }
		});

	});
</script>


#{/set}

#{set title:'Search Results' /}

<div id=main>
<div id="search-results">
<h1>Search Results</h1>
#{if relationList}

Found ${relationList.size()} item${relationList.pluralize()} matching
'${search}'

<ul>
#{list items:relationList, as:'Relation'}


#{if Relation.type == "entity"}
<li><a id="link" href="@{AdvancedSearch.showSourceEntity(Relation.id)}">${Relation.source} </a></li>
#{/if}

#{elseif Relation.type == "topic"}
<li><a id="link" href="@{AdvancedSearch.showSourceTopic(Relation.id)}">${Relation.source} </a></li>
#{/elseif} 

#{else}
<li><a id="link" href="@{AdvancedSearch.showSourceTag(Relation.id)}">${Relation.source} </a></li>
#{/else} 

<li><a id="link" href="@{AdvancedSearch.showSearchRelation(Relation.id)}">${Relation.relationName}- ${Relation.postedAt} </a></li>



#{if Relation.type == "entity"}
<li><a href="@{AdvancedSearch.showDestinationEntity(Relation.id)}">${Relation.destination} </a></li>
#{/if}
#{elseif Relation.type == "topic"}
<li><a href="@{AdvancedSearch.showDestinationTopic(Relation.id)}">${Relation.destination} </a></li>
#{/elseif} 

#{else}
<li><a href="@{AdvancedSearch.showDestinationTag(Relation.id)}">${Relation.destination} </a></li>
#{/else}

</br>
#{/list}
</ul>
#{/if}
#{else}
Sorry! We did not find any results matching '${search}'
#{/else}
</div>
</div>